<!--
  ~ Copyright (C) 2010 Brockmann Consult GmbH (info@brockmann-consult.de)
  ~
  ~ This program is free software; you can redistribute it and/or modify it
  ~ under the terms of the GNU General Public License as published by the Free
  ~ Software Foundation; either version 3 of the License, or (at your option)
  ~ any later version.
  ~ This program is distributed in the hope that it will be useful, but WITHOUT
  ~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  ~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  ~ more details.
  ~
  ~ You should have received a copy of the GNU General Public License along
  ~ with this program; if not, see http://www.gnu.org/licenses/
  -->

<html>

<head>
    <title>Sentinel Toolbox Help - Mask Management</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <link rel="stylesheet" href="../style.css">
</head>

<body>
<table class="header">
    <tr class="header">
        <td class="header">&nbsp;Mask Management</td>
        <td class="header" align="right"><a href="../general/overview/SnapOverview.html"><img src="../images/snap_header.jpg"
                                                                                     border=0></a></td>
    </tr>
</table>

<h2>The Mask Concept</h2>


<p>Masks are useful to mask out image pixels either solely for image display or for
    image analysis. In the latter case we refer to a mask in the role of a region of interest.
    Currently SNAP supports three basic types of mask differing in the way the mask is defined:
</p>

<ol>
    <li>Masks defined by a <i><a href="#BandMath">band maths expression</a></i></li>
    <li>Masks defined by a simple <i><a href="#Range">sample value range</a></i></li>
    <li>Masks defined by <i><a href="#Geometry">geometry</a> such as lines and polygons</i></li>
</ol>

<p>
    In data modelling terms, a mask is a product node similar to a band or tie-point grid. It has a unique name and
    comprises a image (raster data) whose sample data type is Boolean. Each data product may comprise virtually any
    number of masks.
</p>

<p>
    Not only the mask definitions but also their use in conjunction with a raster data set such as a band or tie-point
    grid are part of the data model stored within the product. A product "remembers" for a certain band or tie-point
    grid
</p>
<ul>
    <li>which masks have been switched visible and</li>
    <li>which masks are in use as region of interest.</li>
</ul>

<p>
    A number of product formats define a default mask set. E.g. the Envisat MERIS L1 and L2 product types define a mask
    for each of their quality flags.
</p>

<h2>Working with Masks</h2>

<table>
    <tr>
        <td style="border-width:0"><a name="MaskManager"><img src="images/icons/MaskManager24.png"
                                                                 alt="Mask Manager"></a></td>
        <td style="border-width:0">Masks are managed by the <b>Mask Manager</b> tool window.
            To bring up this tool window click the tool button in the <b>Tool Windows</b> tool bar or select the
            corresponding menu item in <b>View / Tool Windows / Mask Manager</b>.
        </td>
    </tr>
</table>

<p>
    The manager allows creating new masks, editing mask properties and delete existing masks. It also allows
    for creating new masks based on logical combinations of existing masks. Furthermore masks may be
    imported and exported. If an <a href="ProductSceneView.html">Image View</a> is selected, the manager tool
    window can also be used to
    control the visibility and its role as a possible region of interest for the currently displayed band. When the mask's role
    is selected, it becomes available in the various raster data analysis tools, such as
    the <a href="StatisticsDialog.html">Statistics</a>, <a href="HistogramDialog.html">Histogram</a>,
    and <a href="DensityPlotDialog.html">Scatter Plot</a> tool windows.
</p>

<div align="center">
    <table>
        <tr>
            <td style="border-width:0"><img src="images/MaskManager.png" alt="Mask Manager"></td>
        </tr>
        <tr>
            <td style="border-width:0" align="center">Mask Manager tool window</td>
        </tr>
    </table>
</div>

<table>
    <tr>
        <td style="border-width:0"><a name="BandMath"><img src="images/icons/BandMath24.png" alt="Band Maths"></a></td>
        <td style="border-width:0"><b>Band maths expression:</b> Adds a new mask to the product which is based on a band
            maths expression.
            The expression can reference any bands, tie-point grids, single flags or other masks defined in the data
            product. For more information on band maths please refer to <a href="BandMaths.html">Band Maths</a>.
        </td>
    </tr>
    <tr>
        <td style="border-width:0"><a name="Range"><img src="images/icons/Range24.png" alt="Range"></a></td>
        <td style="border-width:0"><b>Value range:</b> Adds a new mask to the product which is based on a value range
            of the selected band. All pixels whose sample values fall within the value range are part of the mask.
        </td>
    </tr>
    <tr>
        <td style="border-width:0"><a name="Geometry"><img src="images/icons/NewVectorDataNode24.gif"
                                                           alt="Geometry"></a></td>
        <td style="border-width:0"><b>Geometry:</b> Adds a new mask to the product which is based on the geometries
            contained in an associated geometry container. The command effectively creates a new geometry container
            which in turn causes the creation of an associated geometry mask. For more information about geometry and
            geometry containers have a look into the <a href="VectorDataManagement.html">Vector Data Management</a>.
        </td>
    </tr>
    <tr>
        <td style="border-width:0"><img src="images/icons/Union24.png" alt="Union"></td>
        <td style="border-width:0"><b>Union:</b> Creates the logical union of two or more selected masks.</td>
    </tr>
    <tr>
        <td style="border-width:0"><img src="images/icons/Intersection24.png" alt="Intersection"></td>
        <td style="border-width:0"><b>Intersection:</b> Creates the logical intersection of two or more selected masks.</td>
    </tr>
    <tr>
        <td style="border-width:0"><img src="images/icons/Difference24.png" alt="Difference"></td>
        <td style="border-width:0"><b>Difference:</b> Creates the logical difference of two or more selected masks (in top-down order).</td>
    </tr>
    <tr>
        <td style="border-width:0"><img src="images/icons/InvDifference24.png" alt="Inv. Difference"></td>
        <td style="border-width:0"><b>Inv. Difference:</b> Creates the logical difference of two or more selected masks (in bottom-up order).</td>
    </tr>
    <tr>
        <td style="border-width:0"><img src="images/icons/Complement24.png" alt="Complement"></td>
        <td style="border-width:0"><b>Complement:</b> Creates the logical complement one or more selected masks.</td>
    </tr>
    <tr>
        <td style="border-width:0"><img src="images/icons/Copy24.gif" alt="Copy"></td>
        <td style="border-width:0"><b>Copy:</b> Creates a copy of the selected mask.</td>
    </tr>
    <tr>
        <td style="border-width:0"><img src="images/icons/Edit24.gif" alt="Copy"></td>
        <td style="border-width:0"><b>Edit:</b> Edits the definition of the selected mask.
            Double-clicking a mask entry in the table has the same effect.</td>
    </tr>
    <tr>
        <td style="border-width:0"><img src="images/icons/Remove24.gif" alt="Remove"></td>
        <td style="border-width:0"><b>Delete:</b> Deletes the selected mask.</td>
    </tr>
    <tr>
        <td style="border-width:0"><img src="images/icons/Import24.gif" alt="Import"></td>
        <td style="border-width:0"><b>Import:</b> Imports a mask from a plain text file.</td>
    </tr>
    <tr>
        <td style="border-width:0"><img src="images/icons/Export24.gif" alt="Export"></td>
        <td style="border-width:0"><b>Export:</b> Exports the selected masks to a plain text file.</td>
    </tr>
</table>


<hr>
</body>
</html>

<!--page visited by UK-->
